package com.onstar.cn.framework.test;
import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.onstar.cn.framework.R;
import com.onstar.cn.framework.annotation.ContentView;
import com.onstar.cn.framework.annotation.FindViewById;
import com.onstar.cn.framework.annotation.http.HeadsValue;
import com.onstar.cn.framework.annotation.http.Request;
import com.onstar.cn.framework.network.HttpInjectUtils;
import com.onstar.cn.framework.network.entity.RequestEntity;
import com.onstar.cn.framework.network.enumtype.HttpAccept;
import com.onstar.cn.framework.network.enumtype.HttpMethod;
import com.onstar.cn.framework.network.enumtype.Language;
import com.onstar.cn.framework.utils.ViewInjectUtils;

//package com.onstar.cn.framework.test;
//
//import android.app.Activity;
//import android.os.Bundle;
//import android.view.View;
//import android.widget.Button;
//import android.widget.TextView;
//import android.widget.Toast;
//
//import com.onstar.cn.framework.R;
//import com.onstar.cn.framework.annotation.ContentView;
//import com.onstar.cn.framework.annotation.FindViewById;
//import com.onstar.cn.framework.annotation.OnClick;
//import com.onstar.cn.framework.annotation.http.HeadsValue;
//import com.onstar.cn.framework.annotation.http.Request;
//import com.onstar.cn.framework.log.LogManager;
//import com.onstar.cn.framework.network.HttpInjectUtils;
//import com.onstar.cn.framework.network.entity.RequestEntity;
//import com.onstar.cn.framework.network.enumtype.HttpAccept;
//import com.onstar.cn.framework.network.enumtype.HttpMethod;
//import com.onstar.cn.framework.network.enumtype.Language;
//import com.onstar.cn.framework.utils.ViewInjectUtils;
//
//@ContentView(R.layout.frame_work_test)
public class MainTestActivity extends Activity {
//
//	@FindViewById
//	private TextView tv_text, tv_text_1;
//	@FindViewById(value = -1)
//	private Button img_view;
	@FindViewById
	private ListView data_list;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ViewInjectUtils.inject(this);
		// setContentView(R.layout.fragment_test);
		//LogManager.getInstance(this).d("img_view.setImageResource(resId)");
		//networkTest();
		List<String> datas=new ArrayList<String>();
		datas.add("dafda");
		datas.add("dafda");
		TestAdapter testAdapter=new TestAdapter(datas, this);
		data_list.setAdapter(testAdapter);
	}

//	@OnClick({R.id.tv_text,R.id.tv_text_1})
//	public void onClick(View view) {
//		Toast.makeText(this, "OnClickTest", Toast.LENGTH_LONG).show();
//	}
//
	@Request(heads = @HeadsValue(accept = HttpAccept.JSON, language = Language.EN), method = HttpMethod.POST)
	public void networkTest() {
		RequestEntity request = null;
		request = HttpInjectUtils.injectHttp(getClass(), "networkTest", request);
	}
//
//	// @Override
//	// public boolean onCreateOptionsMenu(Menu menu) {
//	// // Inflate the menu; this adds items to the action bar if it is present.
//	// getMenuInflater().inflate(R.menu.main, menu);
//	// return true;
//	// }
//	//
//	// @Override
//	// public boolean onOptionsItemSelected(MenuItem item) {
//	// // Handle action bar item clicks here. The action bar will
//	// // automatically handle clicks on the Home/Up button, so long
//	// // as you specify a parent activity in AndroidManifest.xml.
//	// int id = item.getItemId();
//	// if (id == R.id.action_settings) {
//	// return true;
//	// }
//	// return super.onOptionsItemSelected(item);
//	// }
}
